/**
 * 
 */
package diplo;

import java.awt.*;

/**
 * @author Matthew Crist
 *
 */
public class DiploCell {
	private int eco;
	private int mil;
	private int theo;
	private int gov;
	
	public DiploCell() {
		this.eco = 0;
		this.mil = 0;
		this.theo = 0;
		this.gov = 0;
	}
	
	public DiploCell(int eco, int mil, int theo, int gov) {
		this.eco = eco;
		this.mil = mil;
		this.theo = theo;
		this.gov = gov;
	}
	
	public void SetEconomy(int eco) {
		if(eco > 255) {
			this.eco = 1;
		} else {
			this.eco = eco;
		}
	}
	
	public int GetEconomy() {
		if(this.eco <= 0) {
			return 255;
		} else {
			return this.eco;
		}
	}
	
	public void SetMilitary(int mil) {
		if(mil > 255) {
			this.mil = 1;
		} else {
			this.mil = mil;
		}
	}
	
	public int GetMilitary() {
		if(this.mil <= 0) {
			return 255;
		} else {
			return this.mil;
		}	
	}
	
	public void SetTheology(int theo) {
		if(theo > 255) {
			this.theo = 1;
		} else {
			this.theo = theo;
		}
	}
	
	public int GetTheology() {
		if(this.theo <= 0) {
			return 255;
		} else {
			return this.theo;
		}
	}
	
	public void SetGovernment(int gov) {
		if(gov > 255) {
			this.gov = 0;
		} else {
			this.gov = gov;
		}
	}
	
	public int GetGovernment() {
		if(this.gov <= 0) {
			return 255;
		} else {
			return this.gov;
		}
	}
	
	public void DrawCell(int x, int y, Graphics g) {		
		System.out.println("Mil: " + this.mil + ", Eco: " + this.eco + ", Theo: " + this.theo + ", Gov: " + this.gov);
		g.setColor(new Color(this.mil, this.eco, this.theo));
		// Draws a 10x10 cell with the color spectrum provided from the theo/mil/eco/gov params
		g.fillRect(x, y, 25, 25);
	}
}